const key = 'dda12b54689941cb91d276680291eeeb' 
export default {
  getWeatherList(params) {
    const { day, location } = params;
    const url = `https://devapi.qweather.com/v7/weather/${day}d`
    return new Promise((reslove, reject) => {
      wx.request({
        url,
        data: {
          location,
          key
        },
        header: {
          'content-type': 'application/json' // 默认值
        },
        success (res) {
          reslove(res.data)
        },
        fail(res) {
          reject(res?.data || '获取失败')
        }
      })
    })
  }
}